import request from '../axios'

export const getList = (current: number, size: number, params: any) => {
  return request({
    url: '/api/blade-system/region/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    },
  })
}

export const getLazyTree = (parentCode: string, params: any = {}) => {
  return request({
    url: '/api/blade-system/region/lazy-tree',
    method: 'get',
    params: {
      ...params,
      parentCode,
    },
  })
}

export const getDetail = (code: string) => {
  return request({
    url: '/api/blade-system/region/detail',
    method: 'get',
    params: {
      code,
    },
  })
}

export const remove = (id: string) => {
  return request({
    url: '/api/blade-system/region/remove',
    method: 'post',
    params: {
      id,
    },
  })
}

export const submit = (row: any) => {
  return request({
    url: '/api/blade-system/region/submit',
    method: 'post',
    data: row,
  })
}

export const getTenant = (tenantId: string) => {
  return request({
    url: `/api/blade-system/tenant/detail?tenantId=${tenantId}`,
    method: 'get',
  })
}
